Skip to content

fix(mcpx): openapi parameters resolve by (name, in) — operation overrides path level (#1669) - #3053

Merged
dezren39 merged 1 commit into
mainfrom
queue/4228-1669-openapi-param-dedup
Oct 31, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/4228-1669-openapi-param-dedup

Conversation

@dezren39

@dezren39 dezren39 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Implements #1669 (queue task 4228), following the triage in task 1870.

What

  • pkgs/mcpx/internal/openapi/openapi.go: Build now merges path-item and operation parameters through a new resolveParams instead of concatenating the lists. Parameter identity is the (name, in) pair per the OpenAPI spec: an operation-level parameter with the same pair as a path-level one replaces it (operation wins), exactly once in Tool.Params and in the generated schema.
  • A parameter name that appears in two different locations is now a Build-time error naming the tool, the parameter, and both locations — the flat one-bag-of-arguments model keys arguments by name alone, so the schema would otherwise show one property while Call sent the value to both places; schema and wire must not silently disagree.
  • With resolution upstream, buildSchema can no longer emit a duplicated required entry from this pattern.

Tests

  • TestOperationParameterOverridesPathLevel: path-level {id, path, required} redeclared at operation level resolves to one parameter (operation declaration survives), schema required lists id exactly once.
  • TestSameNameTwoLocationsIsABuildError: path-level {key, query} + operation-level {key, header} fails Build with an error naming the tool, "key", query and header.
  • Full go test ./internal/openapi/ -count=1 passes on the laptop worktree; specs without path-level parameters are unchanged (existing suite green).

Out of scope per the task packet: the flat tool model itself, Call required-parameter enforcement for non-path params, cookie handling, and the #1668 map-iteration nondeterminism.

Refs #1669.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…rides path level (#1669)

Build concatenated path-item and operation parameters with no dedup: a path-level parameter redeclared at operation level appeared twice, putting a duplicated entry in the schema required list (invalid), and a same-name parameter in two locations was conflated into one schema property while Call sent the value to both places. resolveParams now merges by the (name, in) identity with the operation winning, and a name appearing in two locations is a Build error naming the tool, parameter and both locations. Regression tests pin both shapes; the full internal/openapi suite passes on the laptop.
@dezren39
dezren39 requested a review from a team as a code owner October 31, 2026 12:35
@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc5b61e9-c641-44f6-b759-bbef105d5457
Commits

Reviewing files that changed from the base of the PR and between 1f8ab4f and 23ce57f.

Files selected for processing: 2
  • pkgs/mcpx/internal/openapi/openapi.go
  • pkgs/mcpx/internal/openapi/openapi_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T12:37:19.592476Z 23ce57f Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 23ce57fdf4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dezren39
dezren39 merged commit b50c074 into main Oct 31, 2026
11 checks passed
@dezren39
dezren39 deleted the queue/4228-1669-openapi-param-dedup branch October 31, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant